import { TransformOptions } from 'babel-core';
import File from './file/File';
import Assembly from './Assembly';
import Loader from './loaders/Loader';


export interface Dict<T> {
    [key: string]: T;
}

export interface Ref<T> {
    value: T;
}

export type AssemblyType = 'single' | 'recursive' | 'recursiveSourceOnly' |
    'modules' | 'modulesAllInOne' | 'allInOne';

export type TemplateRenderer = (s: string, args: any) => Promise<string>;

export interface PageTemplate {
    match: string | RegExp;
    template: string;
    path: string;
    render?: TemplateRenderer;
}

export interface ZPackOptions {
    loaders: Dict<Loader | string>;
    ext: string[];
    host: string;
    avoidError: boolean;
    rootPath: string;
    encoding: string;
    external: Dict<string>;
    babel: TransformOptions;
    transformLibrary: boolean;
    assembly: AssemblyType | Assembly;
    needBootFile: boolean;
    pageTemplate: PageTemplate[];
    printRead: boolean;
    printLoad: boolean;
    printWrite: boolean;
    preload: string[];
    [otherOptions: string]: any;
}
